﻿using Raven;
using UnityEngine;
using Vector2 = Raven.Vector2;
using Vector3 = UnityEngine.Vector3;

public class SpawnPointDisplay : UnityDisplayObject
{
    private SpawnPoint _spawnPoint;

    public SpawnPointDisplay(BaseGameEntity entity) : base(entity)
    {
        _spawnPoint = entity as SpawnPoint;
    }

    public override void Start()
    {
        base.Start();

        Vector2 pos = _spawnPoint.Pos();
        _gameObject.transform.position = new Vector3((float)pos.x, (float)pos.y);
        _gameObject.AddComponent<MeshFilter>().mesh = MeshFactory.EllipseMesh(Vector3.zero, 7, Color.gray);
        MeshRenderer render = _gameObject.AddComponent<MeshRenderer>();
        render.material = new Material(Shader.Find("Sprites/Default"));
    }

    public override void Update()
    {
    }
}